home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / jpegdt / jpeg.datatype.guide (.txt) < prev    next >
Amigaguide Document  |  1996-04-07  |  13KB  |  231 lines

  1. @DATABASE "JPEG.datatype.guide"
  2. @AUTHOR "Steve Goddard"
  3. @NODE Main "JPEG.datatype Documentation"
  4. Table of Contents
  5. @{"Introduction                          " link Introduction}
  6. @{"Requirements                          " link Requirements}
  7. @{"How to Install                        " link Installation}
  8. @{"What is JPEG?                         " link JPEG }
  9. @{"What is a datatype?                   " link Datatypes}
  10. @{"Implementation Details (Release Notes)" link Implementation}
  11. @{"Known Faults                          " link Faults}
  12. @{"Future Enhancements                   " link Enhancements}
  13. @{"Acknowledgements                      " link Acknowledgements}
  14. @ENDNODE
  15. @NODE Introduction
  16. @TITLE "Introduction"
  17. This is V39.1 of the @{"JPEG" link JPEG} @{"datatype" link Datatypes}.  The version information can be
  18. verified by using the AmigaDOS @{B}version@{UB} command on the datatype file
  19. SYS:classes/datatypes/JPEG.datatype after installation.
  20. Once installed, the JPEG datatype means that any datatype-aware programs
  21. can read JPEG image files.
  22. Examples of this are that a JPEG image can be used as a WorkBench screen
  23. backdrop, and Multiview can be used to display them.
  24. The JPEG datatype is freely distributable, but you may not charge for it,
  25. other than for reasonable media and distribution costs such as those
  26. charged by Fred Fish and other reputable PD libraries.
  27. If distributing the datatype as a standalone program, I ask that you
  28. keep the complete archive together, so that users can benefit from these
  29. instructions.
  30. Permission is also given to distribute this datatype as part of a
  31. product, either commercial or PD.  In this case, the datatype will
  32. presumably be considered as part of the product, and not as separate
  33. item, and will be installed/set up as part of the product installation.
  34. Under these circumstances, the action of the datatype is hidden, and
  35. rest of the archive need not be supplied.  I would ask however, that
  36. some acknowledgement be given to myself and the Independent JPEG Group
  37. in the product documentation.  It would be nice if you also let me know
  38. what it is being used for.
  39. Please be aware that since is the first release of the program, no
  40. attempt has been made to do any speed up/optimisation.  That will be
  41. for a future version.
  42. @ENDNODE
  43. @NODE Requirements
  44. @TITLE "Requirements"
  45. Datatypes were introduced with WorkBench 3.0, so the main requirement is
  46. that you have this version of the OS.  Presumably, any future versions of
  47. the OS will also support them.
  48. Do not try to install the datatype if you are using an OS older than 3.0
  49. (i.e. 1.3, 2.04, or 2.1).  The correct directories do not exist, and
  50. nothing will work even if you create them.  I'm afraid you'll have to
  51. find some other program to view your JPEGs with.
  52. In view of the fact that every machine that Commodore have released that
  53. has WorkBench 3.0 installed has been supplied with at least a 68020, the
  54. datatype has been compiled for this processor.  It will therefore not
  55. work on machines with a 68000 or 68010, but a 68020 and above will be OK.
  56. @ENDNODE
  57. @NODE Installation
  58. @TITLE "How to Install"
  59. Installation can be done in one of two ways:
  60. 1) Using Installer
  61. 2) Manual Installation
  62. If you have a copy of Installer, you can simply double click on the
  63. JPEG.datatype.install icon and follow the onscreen instructions.
  64. The Installer script follows the manual sequence below, so you are
  65. advised to read it quickly so that you know what to expect.  In
  66. particular, you are advised to choose a location for JPEGTMP:.
  67. If you do not have Installer, follow the procedure below:
  68. 1) Copy the file JPEG.datatype to the directory SYS:classes/datatypes
  69. (SYS: is a logical name for the disk you boot from).  You can perform
  70. the copy either from the WorkBench or the CLI.  WorkBench users should
  71. note that no icon exists for either the file or the directory, so you
  72. will have to use the WorkBench Window->Show->All Files menu item to
  73. make them visible.
  74. 2) Decide whether you want the datatype to be permanently enabled, or
  75. manually run whenever you want to use it.  Proceed to step 3 for a
  76. permanently enabled installation, otherwise proceed to step 4.
  77. 3) Copy the file JPEG to the directory DEVS:Datatypes (DEVS: is a
  78. logical directory on the disk you boot from.  It is the same as the
  79. DEVS drawer on the boot disk).  If using the CLI, you will also have
  80. to manually copy the icon file JPEG.info.  When you reboot your system,
  81. the JPEG datatype will be avaliable for use.  Proceed to step 5.
  82. 4) Copy the file JPEG to the directory SYS:Storage/Datatypes.  If using
  83. the CLI, you will also have to manually copy the icon file JPEG.info.
  84. The JPEG will not be available until you double click on the JPEG
  85. icon, at which point it will remain installed until a reboot.  Proceed
  86. to step 5.
  87. 5) Modify your user-startup file to include the line
  88. @{B}assign JPEGTMP: xxxx@{UB}
  89. You should replace the line xxxx with the location of somewhere big
  90. and fast.  A hard disk directory would be ideal, or possibly RAM disk
  91. if you have enough RAM.  If you do not make this assignment, the
  92. datatype will ask for it if you ask it to decode certain JPEG images.
  93. This completes installation.
  94. @ENDNODE
  95. @NODE JPEG
  96. @TITLE "What is JPEG?"
  97. JPEG is a method of storing still images designed by the @{B}J@{UB}oint @{B}P@{UB}hotographic
  98. @{B}E@{UB}xperts @{B}G@{UB}roup in the late 1980s.  It is quite a wide-ranging standard,
  99. but most images only use a subset of the full specification.
  100. The unusual thing about JPEG images is that they are lossy.  This contrasts
  101. with the lossless methods used by most other image storage formats
  102. (including IFF).  What this means is that some of the information in the
  103. image is deliberately thrown away in order to reduce the storage
  104. requirements.  The result is that a JPEG is not an exact copy of the
  105. original image, but it only takes up a fraction of the space.  Technically,
  106. this means that the quality of a decompressed JPEG image is not as good
  107. as an IFF, for example.
  108. Fortunately, the compression algorithm is very selective about what
  109. information is discarded, and thus the average person would have some
  110. difficulty in noticing the difference, particularly if the original image
  111. is not available for reference.  The JPEGs I have been using to test this
  112. datatype have been of outstanding quality, with 256 colour images in a
  113. file less than 20K in some cases.
  114. @ENDNODE
  115. @NODE Datatypes
  116. @TITLE "What is a Datatype?"
  117. Datatypes were introduced with WorkBench 3.0, and provide a way for
  118. applications to read data files without having to learn all the messy
  119. details about how the data in the files are stored.
  120. As an example, consider storing pictures on computer.  As Amiga owners,
  121. we are relatively lucky in that all images are stored using the IFF ILBM
  122. format.  Other computers have a bewildering array of incompatible formats,
  123. and there exist commercial packages with the sole purpose of converting
  124. images between them.
  125. If I wanted to write a paint program, it would certainly be more useful
  126. if it could read and maybe write out images in some of these other formats.
  127. However, implementing such feature would be a bit of a nightmare, as I
  128. would have to obtain the specifications of these formats, plus some
  129. test images, and write (and support) a significant amount of code to
  130. read and write these various formats.
  131. A datatype is a little program that performs this conversion for me, and
  132. completely hides all the messy implementation details about what file
  133. headers exist, how they are structured, etc.  My application can open the
  134. datatypes library, pass a file to it and ask if it recognises the format.
  135. The datatypes library has a look at the file, and then consults its list
  136. of installed datatypes to see if any of them recognise it.  It then comes
  137. back to the application with a reply saying "Yup, its a JPEG picture".
  138. My application can then ask for the data to be read in, and after a
  139. short while the library will return the information in an Amiga standard
  140. format, in this case, an IFF image.  Of course, someone has to write the
  141. datatype, but once written and installed, any other program that uses
  142. datatypes can take advantage of it at no extra cost or expense.
  143. This datatype decodes JPEG images, and any application that wishes to
  144. read this format of images can do so without having to know anything about
  145. them.
  146. @ENDNODE
  147. @NODE Implementation
  148. @TITLE "Implementation Details (Release Notes)"
  149. These are the release notes for V39.1 of the JPEG datatype.
  150. This implementation will only decode JPEGs in up to 256 colours.  If you
  151. have a JPEG with more than this number of colours, it will be quantised
  152. down to 256.  In theory, the datatype could be enhanced to use HAM8 for
  153. JPEGs with more colours.
  154. If you are using Multiview to display JPEGs without the SCREEN tooltype/
  155. parameter, the JPEG will be displayed in a window on the WorkBench,
  156. it will be quantised down to however many colours you have set up on your
  157. WorkBench screen.
  158. If you are using Multiview with the SCREEN tooltype/parameter, the
  159. datatype will choose the screen resolution that it thinks is most
  160. appropriate for displaying the image from the selection available in the
  161. display database.  This descision is made using the BestModeID function,
  162. and is based on the size, colour count and aspect ratio of the image.
  163. The JPEG datatype is based around the JPEG decompression code available
  164. from the Independent JPEG Group.  There are many advantages is using an
  165. off-the-shelf item, such as this, not least of which being that I didn't
  166. have to spend time poring over the JPEG specification trying to figure
  167. out what it all meant.  The flip side of the coin is that in certain
  168. regards, the datatype is constrained by the code I have used.
  169. The JPEG specification is a complicated thing, and the JPEG engine does
  170. not purport to decode every possible implementation.  In addition, some
  171. aspects of the spec may be covered by copyright and until the legal
  172. aspects are clarified, any images that use these aspects cannot be
  173. decoded.
  174. If the JPEG engine detects any errors during decoding, it will display
  175. an error requester containing the reason for aborting.
  176. Certain JPEGs require a large amount of temporary space.  If this exceeds
  177. about 1/2 meg, the JPEG engine will attempt to store the information
  178. on disk.  It will expect the logical name JPEGTMP: to be set up.  If this
  179. has not been done, a requester will ask for this volume to be inserted.
  180. At this point, a CLI can be opened, and by performing the assignment
  181. and clicking on Retry, the decode can proceed.
  182. Due to the number and structure of global variables used by the JPEG
  183. engine, the datatype is not reentrant.  It protects itself by only
  184. allowing one JPEG to be decoded at a time.  If you set off two
  185. simulataneous decodes, one will wait for the other to complete.
  186. @ENDNODE
  187. @NODE Faults
  188. @TITLE "Known Faults"
  189. Firstly, the JPEG datatype will not decode every JPEG that exists.  The
  190. underlying JPEG engine is still in development by the Independent JPEG
  191. Group, and from time to time they may release enhanced versions that
  192. decode a wider range of JPEGs.  This version seems to cope quite well
  193. with the range of JPEGs I have access to, but if you see an error message
  194. from the JPEG engine (such as `invalid color conversion'), then you have
  195. a JPEG it can't manage.
  196. The following list describes faults that have been noted during testing:
  197. @{U}1@{UU}  Occasionally, when used with Multiview, a requester from Multiview
  198. bearing the cryptic message `Error -1' appears.
  199. @{U}2@{UU}  There may be a memory hole, such that memory disappears when images
  200. are decoded.  This has defied all my efforts to track down, if indeed it
  201. is still there.
  202. @ENDNODE
  203. @NODE Enhancements
  204. @TITLE "Future Enhancements"
  205. @{U}1@{UU}  The JPEG datatype is based on Release 4 (10-Dec-92) of the JPEG
  206. software by the Independent JPEG group.  As newer versions are released,
  207. I will try and incorporate them into the JPEG datatype.  Future versions
  208. may well improve the speed of decode, and increase the range of JPEGs
  209. that can be decoded.
  210. @{U}2@{UU}  The rest of the JPEG datatype is based on version 39.1 of the GIF
  211. datatype I have released.  There are a number of significant speed
  212. improvements that were subsequently made to the GIF datatype which have
  213. not yet been incorporated into this one.
  214. @ENDNODE
  215. @NODE Acknowledgements
  216. @TITLE "Acknowledgements"
  217. As I have mentioned several times, this product is based in part on work
  218. done by the Independent JPEG Group (of which I am not a member, nor
  219. affiliated in any way).  Without their software, there would be no JPEG
  220. datatype.  My job was also made easier by the fact that the JPEG software
  221. is supplied with compiler switches for the Amiga, so very little
  222. modification was needed to get it to run as a datatype.
  223. The rest of the code was culled from the GIF datatype.
  224. The idea of using an Installer script was suggested by Yury German, and
  225. the one supplied is based on his example.
  226. Please feel free to contact me electronically:
  227. sgoddy@cix.compulink.co.uk
  228. CIS: 100014,674
  229. Steve Goddard 28/07/93.
  230. @ENDNODE
  231.